    // 轮播
    define(()=>{
        return (function(){
            class Banner{
                constructor(){
                    this.left = document.querySelector(".box .btns .left");
                    this.right = document.querySelector(".box .btns .right");
                    this.imgbox = document.querySelector(".box .imgbox");
        
                    this.width = this.imgbox.children[0].offsetWidth;
                    this.len = this.imgbox.children.length;
                    this.index = 0;
                    this.setActive();
                    this.addEvent();
                }
                setActive(){
                    if(this.index<3){
                    move(this.imgbox, {
                        left: -this.index * this.width
                    });
                }
                }
                addEvent(){
                    const that = this;
                    this.left.onclick = function(){
                        that.changeIndex(1)
                    }
                    this.right.onclick = function(){
                        that.changeIndex(2);
                    }
                }
                changeIndex(d){
                    if(d === 1){
                        if(this.index === 0){
                            this.index = 0;
                        }else{
                            this.index--;
                        }
                    }else{
                        if(this.index === this.len-1){
                            this.index = this.len-1;
                        }else{
                            this.index++;
                        }
                    }
                    this.setActive();
                }
            }
            new Banner();
        
        
        
        // 选项卡
            class Tab {
                constructor() {
                    this.simg= document.querySelectorAll(".box .imgbox img");
                    this.item = document.querySelectorAll(".box1 .item");
                    this.index = 2;
                    this.addEvent();
                    this.setIndex();
                    this.setActive();
                }
                setActive() {
                    this.simg[this.index].className = "active";
                    this.item[this.index].style.display = "block";
                }
                setIndex() {
                    for (let i = 0; i < this.simg.length; i++) {
                        this.simg[i].xuhao = i;
                    }
                }
                addEvent() {
                    const that = this;
                    for (let i = 0; i < this.simg.length; i++) {
                        this.simg[i].onmouseover = function () {
                            that.hide();
                             that.show(this);
                            that.index = this.xuhao;
                        }
                    }
                }
                hide() {
                    this.simg[this.index].className = "";
                    this.item[this.index].style.display = "none";
                }
        
                show(now) {
                    now.className = "active";
                    this.item[now.xuhao].style.display = "block";
                }
            }
            new Tab();
        
        
        // 放大镜
        class BigImgMove{
                constructor(index){
                    this.mSpan = document.querySelectorAll(".box1 .cont .item span");
                    this.lBox = document.querySelectorAll(".l_box_bgbox .l_box")
                    this.lImg = document.querySelectorAll(".l_box_bgbox .l_box img")
                    this.mBox = document.querySelectorAll(".box1 .cont .item");
                    this.index=index;
                    this.addEvent();
                 
                }
                addEvent(){
                    const that = this;
                    this.mBox[this.index].addEventListener("mouseover", function(){
                        that.show()
                    })
                    this.mBox[this.index].addEventListener("mouseout", function(){
                        that.hide()
                    })
                    this.mBox[this.index].addEventListener("mousemove", function(eve){
                        const e = eve || window.event;
                        that.move(e);
                        
                    })
        
                
        
                }
                 hide(){
                    this.lBox[this.index].style.display = "none";
                    this.mSpan[this.index].style.display = "none";
                }
                show(){
                    this.lBox[this.index].style.display = "block";
                    this.mSpan[this.index].style.display = "block";
                    this.mSpan[this.index].style.width = this.lBox[this.index].offsetWidth / this.lImg[this.index].offsetWidth * this.mBox[this.index].offsetWidth + "px";
                    this.mSpan[this.index].style.height = this.lBox[this.index].offsetHeight / this.lImg[this.index].offsetHeight * this.mBox[this.index].offsetHeight + "px";
                }
                move(e){
                    let l = e.offsetX - this.mSpan[this.index].offsetWidth/2;
                    let t = e.offsetY - this.mSpan[this.index].offsetHeight/2;
                    if(l < 0) l=0;
                    if(t < 0) t=0;
                    if(l > this.mBox[this.index].offsetWidth - this.mSpan[this.index].offsetWidth){
                        l = this.mBox[this.index].offsetWidth - this.mSpan[this.index].offsetWidth
                    }
                    if(t > this.mBox[this.index].offsetHeight - this.mSpan[this.index].offsetHeight){
                        t = this.mBox[this.index].offsetHeight - this.mSpan[this.index].offsetHeight
                    }
                    this.mSpan[this.index].style.left = l + "px";
                    this.mSpan[this.index].style.top = t + "px";
                    const x = l / (this.mBox[this.index].offsetWidth - this.mSpan[this.index].offsetWidth);
                    const y = t / (this.mBox[this.index].offsetHeight - this.mSpan[this.index].offsetHeight);
                    this.lImg[this.index].style.left = -x * (this.lImg[this.index].offsetWidth - this.lBox[this.index].offsetWidth) + "px"
                    this.lImg[this.index].style.top = -y * (this.lImg[this.index].offsetHeight - this.lBox[this.index].offsetHeight) + "px"
                }
        
        
            }
            new BigImgMove(0);
            new BigImgMove(1);
            new BigImgMove(2);
            new BigImgMove(3);
            new BigImgMove(4);
            new BigImgMove(5);
            new BigImgMove(6);
            new BigImgMove(7);
        })
    })
    